<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>查看数据</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css" media="all">
</head>

<body>

    <form class="layui-form" lay-filter="example">

        <div class="layui-form-item" style="margin-top: 20px">
            <label class="layui-form-label">电影编号:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="movieId" disabled="true" autocomplete="off" id="movieId" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item" style="margin-top: 20px">
            <label class="layui-form-label">电影名称:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="movieName" lay-verify="title" autocomplete="off" disabled="true" id="movieName"
                    class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="margin-top: 20px">
            <label class="layui-form-label">电影评分:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="movieScore" lay-verify="title" autocomplete="off" disabled="true"
                    id="movieScore" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="margin-top: 20px">
            <label class="layui-form-label">电影标签:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="movietag" lay-verify="title" autocomplete="off" disabled="true" id="movietag"
                    class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">电影上映:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="movieTime" lay-verify="required" disabled=" true" id="movieTime"
                    autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">参演人员:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="performerList" lay-verify="required" disabled=" true" id="performerList"
                    autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">电影简介:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="movieComm" lay-verify="required" disabled=" true" id="movieComm"
                    autocomplete="off" class="layui-input">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">电影图片:</label>
            <div class="layui-input-block" style="margin-right: 20px" id="movieImgList"></div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">电影类型:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="movieType" lay-verify="required" disabled=" true" id="movieType"
                    autocomplete="off" class="layui-input">
            </div>
        </div>

    </form>

    <style>
        #movieImgList img {
            margin: 5px;
        }
    </style>
    <script src="../../assets/libs/layui/layui.js" charset="utf-8"></script>
    <script src="../js/util.js" charset="utf-8"></script>
    <script>



        layui.config({
            base: '/module/'
        }).use(['jquery', 'layer', 'table', 'form', 'config'], function () {
            var $ = layui.jquery;
            var layer = layui.layer;
            var table = layui.table;
            var form = layui.form;
            var config = layui.config;
            var req = GetRequest();

            var no = req['editNo'];//获取请求的url参数editNo的值
            //获取当前编辑的数据
            $.ajax({
                url: config.base_server + 'GetmovieById?editNo=' + no,
                dataType: 'json',
                type: 'get',
                success: function (data) {
                    data = data.data;
                    $('#movieId').val(data[0].movieId);
                    $('#movieName').val(data[0].movieName);
                    $('#movieScore').val(data[0].movieScore);
                    $('#movietag').val(data[0].movietag);
                    (data[0].movieImgList).forEach(item => {
                        $('#movieImgList').append('<img  src="' + item + '" alt="" srcset="" disabled="true" name="movieImg" id="movieImg" width="100" height="100" />');
                    })
                    $('#movieComm').val(data[0].movieComm);
                    $('#performerList').val(data[0].performerList.map((item) => item.performerName));
                    $('#movieType').val(data[0].movieType);
                    $('#movieTime').val(data[0].movieTime)
                }
            })
        });
    </script>


</body>